package com.wgod.demo.business.mapper;

import com.wgod.demo.business.model.MetaModel;
import com.wgod.demo.business.model.cond.MetaCond;
import tk.mybatis.mapper.common.Mapper;
import org.apache.ibatis.annotations.Param;

import com.wgod.demo.business.entity.MetaEntity;

import java.util.List;
import java.util.Map;

/**
 * 项目Mapper
 * Created by WGod on 2018/4/29.
 */
public interface MetaMapper extends Mapper<MetaEntity> {

    /**
     * 添加项目
     * @param meta
     * @return
     */
    int addMeta(MetaEntity meta);

    /**
     * 删除项目
     * @param mid
     * @return
     */
    int deleteMetaById(@Param("mid") Integer mid);

    /**
     * 更新项目
     * @param meta
     * @return
     */
    int updateMeta(MetaEntity meta);

    /**
     * 根据编号获取项目
     * @param mid
     * @return
     */
    MetaEntity getMetaById(@Param("mid") Integer mid);


    /**
     * 根据条件查询
     * @param metaCond
     * @return
     */
    List<MetaEntity> getMetasByCond(MetaCond metaCond);

    /**
     * 根据类型获取meta数量
     * @param type
     * @return
     */
    Long getMetasCountByType(@Param("type") String type);

    /**
     * 根据sql查询
     * @param paraMap
     * @return
     */
    List<MetaModel> selectFromSql(Map<String, Object> paraMap);

}
